home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: news.ifm.liu.se!liuida!t94danfr
- From: t94danfr@ida.liu.se (Yankee Doodle Floppy Disk)
- Subject: Re: Q: '\n' character
- X-Nntp-Posting-Host: su2-8.ida.liu.se
- Message-ID: <t94danfr.829996402@news>
- Sender: news@ida.liu.se
- Organization: CIS Dept, Linkoping University, Sweden
- X-Newsreader: NN version 6.5.0 #6 (NOV)
- References: <4kj66f$k0o@ren.cei.net> <1996Apr11.192937.25676@sq.com> <829396473snz@genesis.demon.co.uk> <4kpd2g$eeb@masala.cc.uh.edu> <317109ea.316698628@nntp.ix.netcom.com> <4kt1f2$jjk@sparcserver.lrz-muenchen.de>
- Date: Sat, 20 Apr 1996 10:33:22 GMT
-
- ua302aa@lrz-muenchen.de () writes:
-
- >miker3@ix.netcom.com (Mike Rubenstein) writes:
- >>> Ok, I've got a question at this point. Is it really proper to say
- >>> if (ptr)?
-
- >Yes, it's "proper".
-
- >>Read some different books.
-
- >> if (ptr)
- >> statement1
-
- >>executes statement1 if ptr compares equal to 0 (ISO 6.6.4), i.e., if
- >>ptr == 0.
-
- >I'd say "if (ptr)" is aequivalent to "if ((ptr) != 0)", and "statement1"
- >will be executed if "ptr" does not compare equal to 0
-
- >Kurt
- >--
- >| Kurt Watzka Phone : +49-89-2180-6254
- >| watzka@stat.uni-muenchen.de
-
- Just a tip:
-
- According to Elemtel's styleguide for C/C++ you should really compare
- variables and pointers with something, instead of just typing:
-
- if (ptr)
- statement;
-
- you should type:
-
- if (ptr != something)
- statement;
-
- or:
-
- if (ptr == something_else)
- statement;
-
- This way of writing code prevents the code from being bugprone in some extent.
- Especially while writing large programs.
-
-
- --
-
- ......
- .+(MMMMMMHn.
- :*`xMMMMMMMMMMh.
-